import { routerMap } from '../path';

export default function MatchRoute(key: string) {
  let res = '';
  for (let i = 0; i < routerMap.length; i++) {
    if (!routerMap[i].children) continue;
    else {
      routerMap[i].children?.forEach(item => {
        if (item.path === key) {
          res = item.meta.title;
        }
      });
      break;
    }
  }
  return res;
}
